Repository navigation
Testing: Some GHA workflow improvements when setting up NodeJS - #29078
Merged
Merged
Conversation
This ensures the version of Node.JS is set up prior to configuring or restoring the cache of NPM modules.
|
Size Change: 0 B Total Size: 1.42 MB ℹ️ View Unchanged
|
desrosj
marked this pull request as ready for review
February 17, 2021 13:56
Member
|
It makes a lot of sense to use explicit version numbers for Node.js 👍 I'm wondering if npm won't cause issues at the time of branching for every major WP version. At the moment we might enforce the latest npm version in some actions. We mostly need yo verify. |
gziolo
approved these changes
Apr 1, 2021
gziolo
left a comment
Member
There was a problem hiding this comment.
It requires a rebase now that we formatted all yml files ...
Changes themselves look good.
This ensures the version of Node.JS is set up prior to configuring or restoring the cache of NPM modules.
…into fix/gha-npm-caching
desrosj
requested review from
adamsilverstein,
adamziel,
ajitbohra,
ajlende,
atimmer,
cameronvoell,
chrisvanpatten,
dmsnell,
draganescu,
ellatrix,
guarani,
kevin940726,
mkaz and
mkevins
as code owners
April 5, 2021 14:17
desrosj
removed request for
SergioEstevao,
Soean,
TimothyBJacobs,
adamsilverstein,
ajitbohra,
ajlende,
atimmer,
cameronvoell,
chrisvanpatten,
dmsnell,
ellatrix,
guarani,
karmatosed,
kevin940726,
mapk,
mmtr,
nerrad,
noahtallen,
noisysocks,
ntwb,
oandregal,
pinarol,
spacedmonkey,
swissspidy,
talldan,
tellthemachines and
youknowriad
April 5, 2021 14:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
While working on some 5.6.2 backports, I ran into a few issues with my tests running on PRs and noticed a few inconsistencies in the GHA workflow files.
First, not all workflows explicitly define the desired version of NodeJS. This results in the workflow run using the version of NodeJS installed by default on the GHA runner container, which can change over time. In the
wp/5.6branch, NodeJS 12.x was still used, but the runner container had switched to using NodeJS 14.x and this caused failures.Second, when using the
actions/cacheaction to cache NPM modules, NodeJS should always be set up prior to using this action. Changing the NodeJS version after configuring caching could result in restoring a cache for a different version of NodeJS, or pushing an incorrect cache that may cause issues elsewhere. This could also result in much faster workflow runs when the cache was being configured first (npm iwould have had to re-run if the cache had incorrect dependency versions for the desired NodeJS version).I also noticed that the
actions/setup-nodeaction now has av2release available. I also updated all steps using this action to now usev2.How has this been tested?
Created this PR to allow the tests to run.
Checklist: